package cn.sciento.onelink.utils;

import org.apache.commons.lang3.StringUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TransIdUtil {
    static SimpleDateFormat timeFormat = new SimpleDateFormat("yyyyMMddHHmmss");
    public static String generate(String appId){
        if(StringUtils.isEmpty(appId)){
            throw new NullPointerException("appId 不能为空");
        }
        return appId+timeFormat.format(new Date())+(int)((Math.random()*9+1)*1000);
    }

}
